package com.ht.common.core.enums;

import com.ht.common.core.annotation.EnumDictType;
import com.ht.common.core.utils.StringUtils;

/**
 * 
 * @Title: ReleaseTypeEnum.java
 * @Description: 智能卡口验放传递的关键字信息
 * 1车牌号,2IC卡,3车辆海关编码,4RFID电子车牌,5集中箱号
 * @author zmx
 * @date 2021年11月16日
 * @version V1.0
 */
@EnumDictType(dictType="hs_gate_type",dictName="互市卡口类型")
public enum HsGateTypeEnum
{
	HS_LOCAL_CH("0",0, "互市本地卡口"), 
    ONE_LINE_INAREA_LOAD_PRECHECK("1",1, "一线入区(加载预判)卡"), 
    ONE_LINE_INAREA_PRECHECK("2", 1,"一线入区预判卡（可选）"),
    ONE_LINE_INAREA_RELEASE("3",1, "一线入区放行卡"),
    ONE_LINE_EXITAREA_PRECHECK("4", 1,"一线出区预判卡"),
    ONE_LINE_EXITAREA_RELEASE("5",1, "一线出区放行卡"),
    TWO_LINE_INAREA_LOAD_PRECHECK("6",2, "二线入区（加载预判）卡"),
    TWO_LINE_INAREA_PRECHECK("7",2, "二线入区预判卡（可选）"),
    TWO_LINE_INAREA("8", 2,"二线入区放行"),
    TWO_LINE_EXITAREA_PRECHECK("9",2, "二线出区预判卡"),
    TWO_LINE_EXITAREA_RELEASE("10",2, "二线出区放行卡"),
    ;

    private final String code;
    private final Integer lineNum;
    private final String name;

    HsGateTypeEnum(String code,Integer lineNum, String name)
    {
        this.code = code;
        this.lineNum=lineNum;
        this.name = name;
    }

    public String getCode()
    {
        return code;
    }

    public String getName()
    {
        return name;
    }

	public Integer getLineNum() {
		return lineNum;
	}
	
	
	 public static Integer getLineByCode(String code) {
		 if(StringUtils.isBlank(code)){
			 return null;
		 }
    	 for (HsGateTypeEnum s : HsGateTypeEnum.values())
         {
             if (s.getCode().equals(code))
             {
                 return s.getLineNum();
             }
         }
         return null;
    }
}
